<template>
    <div v-bind:class="[loan_account == 1?'loan':'account','pt44']">
        <div class="banner">

        </div>
        <div class="banner-text">
            <!-- <div class="banner_title">
                产品简介
            </div> -->
            <ul v-if="this.loan_account == 1">
                <li>
                    <img v-bind:src="this.$store.state.imagesUrl + 'lilvdi_icon2.png'"><span>随借随还</span>
                </li>
                <li>
                    <img v-bind:src="this.$store.state.imagesUrl + 'suijiesuihuan_icon2.png'"><span>利率低</span>
                </li>
                <li>
                    <img v-bind:src="this.$store.state.imagesUrl + 'zhichi25tiande duanqichaijie_icon2.png'"><span>支持1—25天的短期拆借</span>
                </li>
            </ul>
            <div v-if="this.loan_account == 2" class="weui-flex">
              <div class="weui-flex__item">
                  <div><img v-bind:src="this.$store.state.imagesUrl + '81tian_icon.png'"></div>
                  <div>81天帐期</div>
              </div>
              <div class="weui-flex__item">
                  <div><img v-bind:src="this.$store.state.imagesUrl + 'lilvdi_icon.png'"></div>
                  <div>利率低</div>
              </div>
              <div class="weui-flex__item">
                  <div><img v-bind:src="this.$store.state.imagesUrl + 'edugao_icon.png'"></div>
                  <div>额度高</div>
              </div>
            </div>

        </div>
        <div class="btn_box">
            <a @click="nextPage" javascript=":;" class="weui-btn weui-btn_primary">我要申请</a>
        </div>

    </div>
</template>

<script>


export default {
    name: 'home',
    data() {
        return {
            msg: 'Welcome to Your Vue.js App',
            loan_account:"1",  // 1:闪贷   2：帐期
        };
    },
    methods:{
        initLoan() {
            this.loan_account = "1";
        },
        initAccount(){
            this.loan_account = "2";
        },
        nextPage(){
            if(this.loan_account == "1"){
                location.hash = "/interest";
            }else{
                location.hash = "/accountIntest";
            }
        },
        getNowDate(){
            $.post(XtsdOrderServlet,{"servlet_type":"query_today"},function(dmsg) {
                if(dmsg.today_response && dmsg.today_response.today){
                    this.$store.commit('setNowDate',dmsg.today_response.today);
                }
            }.bind(this));

        }
    },
    beforeMount:function  () {
        console.log(this.$route.query.type == "account");
        if(this.$route.query.type == "account"){
            this.initAccount();
            this.$store.commit('changeTitle','小通帮你延');
        }else{
            this.initLoan();
        }
    }
};
</script>

<style lang='scss' scoped>
@import "../assets/scss/vendors/weui-sass/src/style/base/mixin/_setOnepx";

.banner{
    background-size: 100%;
    background-repeat: no-repeat;
}
.loan{
    .banner{
        height: 180px;
        background-image: url('/FuLiBao/Lenovo/static/images/shouye_icon.png');
    }
}
.account{
    .banner{
        height: 290px;
        background-image: url('/FuLiBao/Lenovo/static/images/banner-1.png');
    }
}
.banner-text{
    text-indent:2em;
    position:relative;
    padding:15px;
    background:#fff;
/*     p{
    background:linear-gradient( #fff 98%, #58b 1%);
    background-size: 100% 30px;
    line-height: 30px;

} */

}
.weui-flex__item{
    text-align: left;
    img{
        margin-left: 5px;
        width: 40px;
        margin-bottom: 13px;
    }
}

ul li{
    list-style-type: none;
    font-size: 20px;
    line-height: 45px;
    margin-left: -20px;
    img{
        height: 24px;
        vertical-align: middle;
        margin-right: 20px;
    }

}

</style>
